📦 james7132 / GTCourseWork

📄 shop.pyc · 17 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17�
�^UNc@sddd��YZdS(t	FruitShopcBs,eZd�Zd�Zd�Zd�ZRS(cCs||_||_d|GHdS(s�
            name: Name of the fruit shop
            
            fruitPrices: Dictionary with keys as fruit 
            strings and prices for values e.g. 
            {'apples':2.00, 'oranges': 1.50, 'pears': 1.75} 
        sWelcome to %s fruit shopN(tfruitPricestname(tselfRR((s'D:\Documents\Schoolwork\CS 3600\shop.pyt__init__s		cCs'||jkrd|GHdS|j|S(s�
            fruit: Fruit string
        Returns cost of 'fruit', assuming 'fruit'
        is in our inventory or None otherwise
        sSorry we don't have %sN(RtNone(Rtfruit((s'D:\Documents\Schoolwork\CS 3600\shop.pytgetCostPerPounds	cCsMd}x@|D]8\}}|j|�}|dkr
|||7}q
q
W|S(s�
            orderList: List of (fruit, numPounds) tuples
            
        Returns cost of orderList. If any of the fruit are  
        gN(RR(Rt	orderListt	totalCostRt	numPoundstcostPerPound((s'D:\Documents\Schoolwork\CS 3600\shop.pytgetPriceOfOrder"scCs|jS(N(R(R((s'D:\Documents\Schoolwork\CS 3600\shop.pytgetName/s(t__name__t
__module__RRRR
(((s'D:\Documents\Schoolwork\CS 3600\shop.pyR	s			
N((R(((s'D:\Documents\Schoolwork\CS 3600\shop.pyt<module>	s